#include <iostream>
using namespace std;

struct Clock
{
    int H, M, S;
};

Clock MyClock;

void setTime(int H, int M, int S)
{
    MyClock.H = H >= 0 && H <= 24 ? H : 0;
    MyClock.M = M >= 0 && M <= 60 ? M : 0;
    MyClock.S = S >= 0 && S <= 60 ? S : 0;
}

void showTime()
{
    cout << MyClock.H << ":" << MyClock.M << ":" << MyClock.S << endl;
}

int main()
{
    showTime();
    setTime(8, 31, 59);
    showTime();
}